//利用逆向思维，从target变成start，尽可能去/2
public class Solution991 {
    public int brokenCalc(int startValue, int target) {
        int ans=0;
        while (startValue<target){
            if (target%2==1){
                target++;
            }else {
                target=target/2;
            }
            ans++;
        }
        return ans+startValue-target;
    }

    public static void main(String[] args) {
        System.out.println(new Solution991().brokenCalc(5,8));
    }
}
